<template>
  <div>
    <pageTop :text="text"></pageTop>
    <div @click="blank" class="body">
      <slideBar></slideBar>
      <div>
        <van-tabs v-model="active" swipeable >
          <van-tab v-for="(v,key) in list" :title="v.name" :key="key">
            <div>
              <goodsCommend :category_id="v.category_id" style="margin-top: 2.5vw">
              </goodsCommend>
            </div>
          </van-tab>
        </van-tabs>

      </div>
      <gotop></gotop>
    </div>

  </div>
</template>

<script>
  import pageTop from '../components/pageTop'
  import slideBar from '../components/slideBar'
  import gotop from '../components/public/goTop'
  import goodsCommend from '../components/goodsCommend'
  import pageBottom from '../components/pageBottom'
    export default {
        name: "club",
      components:{
        pageTop,
        slideBar,
        gotop,
        goodsCommend,
        pageBottom
      },
      data(){
          return{
            text:'社区精选',
            active:0,
            list:[],
            category_id:[],

          }
      },
      methods:{
        blank(){
          $("#containers").css(
            {"transform":"translateX(0vw)","transition":"transform .5s"});
        },
        menu(){
          $("#containers").css(
            {"transform":"translateX(72vw)","transition":"transform .5s"});
        }
      },
      created(){
        var that=this;
        this.$http({
          url:'/super/api/home/index',
          method:'post',
          data:{
            time:this._globe.time1,
            device_id:this._globe.device_id,
            version:this._globe.version,
            platform:this._globe.platform,
            token:this._globe.token1,
          }
        })
          .then(function (response) {
           /* console.log(response);*/
            const resData=response.data;
            if(resData.code==1){
              that.list=resData.data.list;
              /*that.res=resData;
              console.log( that.res);*/
            }
          })
          .catch(function (response) {
            console.log(response);
          })

      },
    }
</script>

<style scoped lang="scss">
.body{
  margin-bottom: 8vh;
}
</style>
